# str = input(); print(str)

try:
    ioFile = open("py-tools/io.txt", "r+")
    ioFile.write("line text")
# 写入文件内时，指针到尾部，需要重新定位到头，再去读
    ioFile.seek(0)
    print(ioFile.read())
except IOError:
    print("Error:no file")
else:
    print("try-except-else语块执行完毕")

try:
    pass 
finally:
    pass

# 手动抛出异常
# raise Exception("Invalid level!", 1)

if (not ioFile.closed) : 
    ioFile.close()
# os.mkdir("py-tools/new folder")
# print(os.getcwd())